import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// @ts-ignore
import DefineOptions from 'unplugin-vue-define-options/vite';
import vueJsx from '@vitejs/plugin-vue-jsx';
export default defineConfig({
  define: {
    // https://blog.csdn.net/cg_ssh/article/details/135396904
    __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: true
  },
  plugins: [vue(), DefineOptions(), vueJsx()],
  server: {
    // port: 8000,
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        ws: true,
        rewrite: path => path.replace(/^\/api/, '')
      }
    }
  },
});
